package com.settlement.system.service;

import com.settlement.system.common.exception.ServiceException;
import com.settlement.system.model.entity.common.SinglePage;
import com.settlement.system.model.entity.common.TblReceiveRefundAccount;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;
import java.util.Map;

/**
 * 收退款-账号 服务类
 *
 * @author Ximi
 * @since 2020-07-07
 */

public interface ITblReceiveRefundAccountService extends IBaseService {

    /**
     * 根据NC虚拟账号,获取账号信息
     *
     * @param ncVirtualAccount   NC虚拟账号
     * @param checkAccountBookNo 核算账簿编码
     * @param ncShopNo           Nc店铺编码
     * @return
     * @throws ServiceException
     */
    public List<TblReceiveRefundAccount> getAccount(String ncVirtualAccount, String checkAccountBookNo, String ncShopNo) throws ServiceException;

    /**
     * 获取NC虚拟账号数量
     *
     * @param params
     * @return
     * @throws ServiceException
     */
    public int getNcVirtualAccountCount(Map<String, Object> params) throws ServiceException;

    /**
     * getNcVirtualAccountNameCount
     * @param params
     * @return
     * @throws ServiceException
     */
    public int getNcVirtualAccountNameCount(Map<String, Object> params) throws ServiceException;

    /**
     * 获取NC虚拟账号列表
     *
     * @param singlePage
     * @param params
     * @param orderByField
     * @param orderBy
     * @return
     * @throws ServiceException
     */
    List<TblReceiveRefundAccount> getNcVirtualAccountList(SinglePage singlePage, Map<String, Object> params, String orderByField, String orderBy) throws ServiceException;

    /**
     * getNcVirtualAccountNameList
     * @param singlePage
     * @param params
     * @param orderByField
     * @param orderBy
     * @return
     * @throws ServiceException
     */
    List<TblReceiveRefundAccount> getNcVirtualAccountNameList(SinglePage singlePage, Map<String, Object> params, String orderByField, String orderBy) throws ServiceException;

    /**
     * 根据NC虚拟账号获取账号表数据
     *
     * @param ncVirtualAccount 虚拟账号
     * @return
     * @throws ServiceException
     */
    public List<TblReceiveRefundAccount> getByNcVirtualAccount(String ncVirtualAccount) throws ServiceException;

    /**
     * getChannelNameByNcVirtualAccountName
     * @param ncVirtualAccountName
     * @return
     * @throws ServiceException
     */
    public String getChannelNameByNcVirtualAccountName(String ncVirtualAccountName) throws ServiceException;

    /**
     * 根据NC虚拟账号获取账号表数据
     *
     * @param ncEnterAccountBody 入账主体
     * @return
     * @throws ServiceException
     */
    public List<TblReceiveRefundAccount> getByNcEnterAccountBody(String ncEnterAccountBody) throws ServiceException;

    TblReceiveRefundAccount selectExistAccount(TblReceiveRefundAccount account) throws ServiceException;

    /**
     * 通过账号获取线下打款账号
     *
     * @param loginAccount
     * @return
     * @throws ServiceException
     */
    @Cacheable("rrOrAccountByLoginAccount")
    TblReceiveRefundAccount getOrByLoginAccount(String loginAccount) throws ServiceException;

    TblReceiveRefundAccount getOrByShopAccount(String shopAccount) throws ServiceException;
}

